package com.da.javatest.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Author: chenlida
 * @Date: 2018/11/13 14:06
 * @Description:
 */
@Aspect
@Component
public class ServiceAspect {
    @Pointcut("execution(public * com.da.javatest.service.MyService.*(..))")
    public void webLog() {}

    @Before("webLog()")
    public void test(JoinPoint joinPoint) {
        System.out.println(joinPoint.getSignature().getName());
        System.out.println("log.....日志打印成功!");
    }
}
